package mytest;

import com.xyd.dao.UserDao;
import com.xyd.entity.User;
import com.xyd.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

public class Demo {

    @Test
    public void test1() {
        System.out.println("haooolo");
    }

    @Test
    public void testMybatis1() {
        SqlSession session = SqlSessionFactoryUtil.getSqlSession();
        UserDao userDao = session.getMapper(UserDao.class);

        User u = userDao.login(new User("admin", "111"));

        System.out.println(u.getUserid() + "," + u.getName());

    }
}
